package com.mock;

import org.mockito.Mockito;
import org.mockito.stubbing.OngoingStubbing;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

/**
 * 作者: LCG
 * 日期: 2020/3/8 22:01
 * 描述:
 */

@Component
public class TestMockClass {



    public String test01(){

        TestMockService mock = Mockito.mock(TestMockService.class);
        Mockito.when(mock.test()).thenReturn("测试接口");




        return mock.test();
    }

}
